home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cgazv5n5.arc
/
XMS.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-23
|
3KB
|
109 lines
/*--- XMS.H ------------------------------ Listing 2 -----
* XMS definitions and related information
*
* by David Babcock
*
* Validated for Microsoft and Borland C/C++
*
* (c) 1991 C Gazette. Object Code may be used freely,
* source code may be used if authorship and publication
* are acknowledged.
*-------------------------------------------------------*/
#if __TURBOC__
#define CDECL
#else
#define asm _asm
#define CDECL _cdecl
#endif
typedef void (far *pfv)( void ); /* needed by Microsoft */
struct xms_struc_type
{
unsigned int ret_dx ;
unsigned int ret_bx ;
pfv func ;
} ;
union uoffset
{
void far *p;
unsigned long o;
};
/*---------------------------------------------------------
* The definition for the following structure copies the one
* in the XMS specification, for ease of reference.
* This structure must be fully packed - do not let the
* compiler pad it. For MSC, this means the #pragma pack(1)
* directive is needed.
*-------------------------------------------------------*/
#if !defined(__TURBOC__)
#pragma pack(1) /* no packing */
#endif
struct ExtMemMoveStruct
{
unsigned long Length ;
unsigned int SourceHandle ;
union uoffset SourceOffset ;
unsigned int DestHandle ;
union uoffset DestOffset ;
} ;
#if !defined(__TURBOC__)
#pragma pack() /* revert to default packing */
#endif
extern int EMBhandle;
extern struct xms_struc_type xms_struc;
extern struct ExtMemMoveStruct XMSMoveStruct;
/*---- far pointer macros ----*/
#if !defined(MK_FP)
#define MK_FP(seg,off) \
(void far*)((((unsigned long)(seg))<<16)|(off))
#endif
#if !defined(FP_SEG)
#define FP_SEG(p) ((unsigned int)((p)>>16))
#endif
#if !defined(FP_OFF)
#define FP_OFF(p) ((unsigned int)(p)
#endif
/*---------------------------------------------------------
* The following #define specifies the earliest version
* acceptable for the memory manager to operate.
*-------------------------------------------------------*/
#define MIN_XMS_VER 0x200
/* Prototypes in xmsgen and called by XMSUMB, XMSEMB, XMSHMA */
unsigned long XMSfunction(unsigned, unsigned, unsigned );
void closeXMS ( void );
int initXMS ( void );
unsigned int basicXMSfunction ( unsigned, unsigned, unsigned );
unsigned long dxbxXMSfunction ( unsigned, unsigned );
int GetXMSVersionNumber ( void );
int RequestHighMemoryArea ( unsigned );
int ReleaseHighMemoryArea ( void );
int GlobalEnableA20 ( void );
int GlobalDisableA20( void );
int LocalEnableA20 ( void );
int LocalDisableA20 ( void );
int QueryA20 ( void );
unsigned long QueryFreeExtendedMemory ( void );
int AllocateExtendedMemoryBlock ( unsigned );
int FreeExtendedMemoryBlock ( unsigned );
int MoveExtendedMemoryBlock ( void far *p );
unsigned long LockExtendedMemoryBlock ( unsigned );
int UnlockExtendedMemoryBlock ( unsigned int );
unsigned long GetEMBHandleInformation ( unsigned );
int ReallocateExtendedMemoryBlock(unsigned, unsigned);
int RequestUpperMemoryBlock ( unsigned );
int ReleaseUpperMemoryBlock ( unsigned );
char *PrintXMSVersionNumber ( unsigned );